<template>
  <div class="cartoon-form-container">
    <el-card class="basic-info">
      <el-tabs v-model="activeName" tab-position="left" class="profile-card">
        <el-tab-pane label="用户信息采集" name="info">
          <change-version></change-version>
        </el-tab-pane>
        <el-tab-pane label="控件操作" name="control">
          <delivery-control></delivery-control>
        </el-tab-pane>
      </el-tabs>
    </el-card>
  </div>
</template>

<script setup lang="ts">
import {onMounted, ref} from 'vue';
import UserDemand from './user-demand.vue';
import DeliveryControl from './delivery-control.vue';
import {ElMessage} from "element-plus";
import ChangeVersion from "./change-version.vue";

const activeName = ref('info');


onMounted(async () => {
  try {
    // 获取投递窗口的状态信息
    const deliveryStatus = await window.bossHandleApi.getDeliveryStatus();
    console.log('打印投递窗口的信息', deliveryStatus);

    // 根据状态信息设置 activeName 的值
    if (!deliveryStatus) {
      activeName.value = 'control';
    }
  } catch (error) {
    console.error('获取投递窗口状态信息失败：', error);
    ElMessage.error('获取投递窗口状态信息失败，请稍后重试');
    // 可以根据具体需求进行错误处理，比如记录日志或者展示错误信息给用户
  }
});
</script>

<style scoped>
.el-form-item {
  margin-bottom: 20px;
}

.el-input, .el-select {
  width: 100% !important;
}

.el-input__inner, .el-select .el-input__inner {
  box-sizing: border-box !important;
}

.el-select .el-input__inner {
  width: 100% !important;
}


</style>
